define(["jquery","utils","HeatMapArea","KeyHeatPoint"], function($,utils, HeatMapArea,KeyHeatPoint){

    function HeatMapKeyArea(obj) {
        // private stuff
        HeatMapArea.call(this,obj);

    };
    //erste den Prototyepen mit dem Parent überschreiben
    var _super = utils.extend(HeatMapKeyArea,HeatMapArea);
    //anschließend den  Prototypen der Klasse erweitern
    $.extend(HeatMapKeyArea.prototype, {

        initKeyList :function(){
            var linestart = 0;
            var distance = 36;
            var height = 0;

            linestart = 43.25;
            distance = 35.75;
            height = 45;

            this.heatPointList.push(new KeyHeatPoint(utils.KEY.TILT,        linestart +(distance*0),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N1,          linestart +(distance*1),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N2,          linestart +(distance*2),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N3,          linestart +(distance*3),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N4,          linestart +(distance*4),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N5,          linestart +(distance*5),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N6,          linestart +(distance*6),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N7,          linestart +(distance*7),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N8,          linestart +(distance*8),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N9,          linestart +(distance*9),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.N0,          linestart +(distance*10),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.QUESTIONMARK,linestart +(distance*11),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.HIGHCOMA,    linestart +(distance*12),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.BACKSPACE,    linestart+(distance*13),height));


            linestart = 96;
            distance = 35.75;
            height = 87;
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.TAB,         52,height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.Q,           linestart +(distance*0),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.W,           linestart +(distance*1),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.E,           linestart +(distance*2),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.R,           linestart +(distance*3),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.T,           linestart +(distance*4),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.Z,           linestart +(distance*5),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.U,           linestart +(distance*6),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.I,           linestart +(distance*7),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.O,           linestart +(distance*8),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.P,           linestart +(distance*9),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.UE,          linestart +(distance*10),height));
            this.heatPointList.push(new KeyHeatPoint(utils.KEY.MULT_PLUS,   linestart +(distance*11),height));

            linestart = 108;
            distance = 35.75;
            height = 130;
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.CAPSLOCK,    58,height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.A,           linestart +(distance*0),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.S,           linestart +(distance*1),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.D,           linestart +(distance*2),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.F,           linestart +(distance*3),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.G,           linestart +(distance*4),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.H,           linestart +(distance*5),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.J,           linestart +(distance*6),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.K,           linestart +(distance*7),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.L,           linestart +(distance*8),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.OE,          linestart +(distance*9),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.AE,          linestart +(distance*10),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.HASH,        linestart +(distance*11),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.ENTER,       linestart +(distance*12),height));

            linestart = 90;
            distance = 35.75;
            height = 174;

             this.heatPointList.push(new KeyHeatPoint(utils.KEY.SHIFT,       48,height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.PIPE,        linestart +(distance*0),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.Y,           linestart +(distance*1),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.X,           linestart +(distance*2),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.C,           linestart +(distance*3),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.V,           linestart +(distance*4),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.B,           linestart +(distance*5),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.N,           linestart +(distance*6),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.M,           linestart +(distance*7),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.COMA,        linestart +(distance*8),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.DOT,         linestart +(distance*9),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.UNDERLINE,   linestart +(distance*10),height));
            

            linestart = 747;
            distance = 35.75;
            height = 48;
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD,      linestart +(distance*0),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.SLASH1,      linestart +(distance*1),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.MULTIPLY,    linestart +(distance*2),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.MINUS,       linestart +(distance*3),height));

            height = 90;

             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD7,     linestart +(distance*0),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD8,     linestart +(distance*1),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD9,     linestart +(distance*2),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.PLUS,        linestart +(distance*3),height));
            
            height = 133;
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD4,     linestart +(distance*0),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD5,     linestart +(distance*1),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD6,     linestart +(distance*2),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.PLUS,        linestart +(distance*3),height));
           
            height = 176;
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD1,     linestart +(distance*0),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD2,     linestart +(distance*1),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD3,     linestart +(distance*2),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.ENTER,       linestart +(distance*3),height));

            height = 218;
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD0,     linestart +(distance*0),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPAD0,     linestart +(distance*1),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.NUMPADDOT,   linestart +(distance*2),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.ENTER,       linestart +(distance*3),height));

            linestart = 605;
            
            height = 218;

             this.heatPointList.push(new KeyHeatPoint(utils.KEY.CTRL,        52,height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.ALT,         146,height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.SPACE,       294,height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.LEFTARROW,   linestart +(distance*0),height));
            
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.INSERT,      linestart +(distance*0),48));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.DELETE,      linestart +(distance*0),90));

             this.heatPointList.push(new KeyHeatPoint(utils.KEY.UPARROW,     linestart +(distance*1),height-45));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.DOWNARROW,   linestart +(distance*1),height));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.END,         linestart +(distance*1),48));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.HOME,        linestart +(distance*1),90));

             this.heatPointList.push(new KeyHeatPoint(utils.KEY.RIGHTARROW,  linestart +(distance*2),height));

             this.heatPointList.push(new KeyHeatPoint(utils.KEY.PAGEUP,      linestart +(distance*2),48));
             this.heatPointList.push(new KeyHeatPoint(utils.KEY.PAGEDOWN,    linestart +(distance*2),90));
            
             this.heatPointList.addStrokeToKey = function(xKey){
                if ( utils.stopanalyse) return;
                for(var i = 0; i < this.length;i++)
                    if(xKey == this[i].keyCode){
                        this[i].addStroke();
                }
            };

             this.heatPointList.clearList = function(){
                $.each( this, function(index, val) {
                    val.Count =0;
                });
            }
        }
    });
   return HeatMapKeyArea;
});